package com.leyou.search.service;

import com.leyou.pojo.Spu;
import com.leyou.search.pojo.Goods;
import com.leyou.search.pojo.SearchRequest;
import com.leyou.search.pojo.SearchResult;
import org.springframework.stereotype.Service;

import java.io.IOException;

@Service
public interface SearchService {

    /**
     * 将Spu转变为Goods
     *
     * @param spu
     * @return
     * @throws IOException
     */
    Goods buildGoods(Spu spu) throws IOException;

    /**
     * 搜索商品
     *
     * @param request
     * @return
     */
    SearchResult search(SearchRequest request);

    /**
     * 创建索引
     *
     * @param id
     */
    void createIndex(Long id) throws IOException;

    /**
     * 删除索引
     *
     * @param id
     */
    void deleteIndex(Long id);
}